#coding:utf8
filename = raw_input("请输入你要打开的文件名称:")

try:
    f = open(filename)
except IOError,msg:
    print "你输入的文件不存在"
except NameError,msg:
    print "内部变量调用错误"
finally:
    print "ok"
    try:
        f.close()
    except NameError,msg:
        pass

if filename == "hello":
    raise TypeError("nothing!!")

